import { defineComponent } from "vue";
import { Switch } from "vant";
import { IFormSwitchProps } from "./types";

export default defineComponent({
  name: "switch-view",
  props: IFormSwitchProps,
  emits: ["update:modelValue"],
  setup(_, { emit }) {
    return () => {
      return (
        <Switch
          modelValue={_.modelValue}
          onChange={(data) => {
            emit("update:modelValue", data);
          }}
          size={"24px"}
        />
      );
    };
  },
});
